package Testwork;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;


public class Main {

	public static void main(String[] args) {
		List<Student> list =new ArrayList<Student>();
		Student[] s=new Student[3];
		s[0]=new Student(8l,"zhang",18,Gender.boy,true);
		s[1]=new Student(12l,"zhang",25,Gender.girl,true);
		s[2]=new Student(22l,"zhang",21,Gender.girl,true);
		list.add(s[0]);
		list.add(s[1]);
		list.add(s[2]);
		List<Student> list1 =list.stream().filter(a -> (a.getId()>10l&&a.getName().equals("zhang")&&a.getAge()>20&&a.getGender().equals(Gender.girl)&&a.isJoinsACM())).collect(Collectors.toList());
		for (int i = 0; i < list1.size(); i++) {
			System.out.println(list1.get(i));
		}
//		for(Student a:s){
//		if(a.getId()>10&&a.getName().equals("zhang")&&a.getAge()>20&&a.getGender().equals(Gender.girl)&&a.isJoinsACM()){
//			list.add(a);
//			
//		}
//	}
		
	}
	

}
